package ph.com.gs3.sockettest.Manager;

import io.socket.IOCallback;
import io.socket.SocketIO;

import java.net.MalformedURLException;

public class SocketIOCommunicatorModule {

	public static final String TAG = SocketIOCommunicatorModule.class.getSimpleName();

	private SocketIO socket = null;

	public SocketIOCommunicatorModule() {}

	public void publishTestMessage() {
		socket.emit("send", "sample message");
	}

	public void initialize(IOCallback ioCallback) {

		try {
			socket = new SocketIO("http://192.168.0.101:3013");
			socket.connect(ioCallback);
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}

	}
}
